<%@ page import="java.util.List" %>
<%@ page import="com.neuedu.mvc.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/3/18
  Time: 16:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--<%--%>
<%--    List<User> userList = (List<User>) request.getAttribute("userList");--%>
<%--%>--%>
<h3>用户列表: </h3>
<a href="${pageContext.request.contextPath}/user/toAdd">添加</a>
<a href="${pageContext.request.contextPath}/user/toAdd2">添加2</a>
<a href="${pageContext.request.contextPath}/user/toBatchAdd">批量添加</a>


<form action="${pageContext.request.contextPath}/user/batchDel" method="post">
    <button type="submit">批量删除</button>
<table cellspacing="0" cellpadding="0"  width="100%" border="1">
    <tr>
        <td>全选 </td>
        <td>序号</td>
        <td>用户id</td>
        <td>用户名</td>
        <td>性别</td>
        <td>出生日期</td>
        <td>状态</td>
        <td>操作</td>
    </tr>

    <c:forEach items="${userList}" var="user" varStatus="status">
        <tr>
            <td><input type="checkbox" name="ids" value="${user.userId}"> </td>
            <td>${status.count}</td>
            <td>${user.userId}</td>
            <td>${user.userName}</td>
            <td>${user.gender}</td>
            <td>${user.birthday}</td>
            <td>${user.status}</td>
            <td>
                <a href="${pageContext.request.contextPath}/user/toEdit?userId=${user.userId}">修改</a>
                <a href="${pageContext.request.contextPath}/user/toEdit2?userId=${user.userId}">仅修改用户名</a>


            </td>
        </tr>
    </c:forEach>

</table>
</form>





</body>
</html>
